Bug 8845 Old Prices Calculated in Req. Worksheet - #10213
Bug 8845 Old Prices Calculated in Req. Worksheet#10213Dan Karlsson (Dan-Karlsson) wants to merge 2 commits into
Conversation
Agentic PR Review - Round 1Recommendation: AcceptWhat this PR doesThis fixes purchase price calculation on requisition lines when planning dates would place the order date before the work date. The code now keeps price calculation on the work date while preserving the calculated starting date unless the Order Date field is validated directly. The main changed paths use Order Date as the price document date, so the old-price case is addressed without changing posting code or public APIs. The added regression test covers two vendor price periods and checks that the current price is selected. SuggestionsNo suggestions. Risk assessment and necessityRisk: This touches requisition worksheet planning dates and purchase direct unit cost. A mistake here could choose the wrong vendor cost on planned supply, but the change is narrow and does not change posting code, event signatures, or public procedure signatures. Necessity: The linked bug is valid because a rush order can otherwise use an obsolete purchase price when lead time pushes the calculated order date into the past. The scope is right for the issue, and the tests cover the price regression plus related planning date expectations.
|
Agentic PR Review - Round 2Recommendation: AcceptWhat this PR doesSame fix as round 1: on requisition lines, keep purchase price calculation on the work date instead of an order date in the past, and only update Starting Date when Order Date is validated directly. The single new commit ran Invoke-Miapp and propagated the Status of previous suggestionsRound 1 raised no suggestions, so there is nothing to track here. New observations (commits since round 1)None. The new commit only propagates the accepted W1 logic to the IT layer and adds the parallel test copies; the production logic is unchanged and consistent across layers. Risk assessment and necessityRisk: Still limited to requisition worksheet planning dates and purchase direct unit cost. No posting code, event signatures, or public procedure signatures change. The country-layer propagation matches W1 byte-for-byte, so it adds no new behavior. Necessity: Unchanged from round 1. The bug is valid and the scope is right; propagating to the country layer is the correct follow-up.
|
|
This PR changes the runtime contract of the public Agent judgement — not directly backed by a BCQuality knowledge article. Line mapping was unavailable, so this was posted as an issue comment. 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.33.4 |
The build errors doesn't seem to be related to this PR? I can't find any reason why MfgSalesOrderPlanning.PageExt.al would change? |
What & why
Does not set Order Date in Requisition Line to an older date than workdate when validating other fields, to make the price calculations correct.
Only update Starting Date when it is also validated to not set a faulty starting date. Also doesn't make sense to set starting date without validation since the field Starting Date-Time will not be synchronised.
Same pull request as microsoft/BusinessCentralApps#1869 that was closed when base app moved.
Linked work
Fixes #8845
How I validated this
What I tested and the outcome (required — be specific: scenarios, commands, screenshots for UI changes)
Risk & compatibility
Starting Date isn't set when validating Order Date on Requisition Line from code. Should be a small risk since Starting Date-Time wasn't synchronised without further field validations.